﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tulde.WindowsPhone.Music
{
    /// <summary>
    /// 
    /// </summary>
    public interface IViewModelSerializer
    {
        /// <summary>
        /// Converts the given instance into a serialized string
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
         string Serialize(object instance);
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="serializedInstance"></param>
        /// <returns></returns>
         T Deserialize<T>(string serializedInstance);
         /// <summary>
         /// 
         /// </summary>
         /// <typeparam name="T"></typeparam>
         /// <param name="serializedInstance"></param>
         /// <returns></returns>
         object Deserialize(Type type,string serializedInstance);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
         string SerializeToUrlParameter(object instance);
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="queryStringParameters"></param>
        /// <returns></returns>
         T DeserializeFromUrlParameter<T>(IDictionary<string, string> queryStringParameters);
    }
}
